#include <stdio.h>
extern int      pl_start();
extern char*    pl_eval(char* code);
extern char*    pl_error();
extern void     pl_stop();

void evalCode(char *code)
{
	char *ret;
	char *error;
	
	printf("evalaiting----%s\n", code);
	ret=pl_eval(code);
 	if (ret!=NULL)
 	{
 		printf("result: %s\n", ret);
 	} else
 	{
 		error=pl_error();
 		printf("error is %s\n", error);
 	}
 		
 	

}
main (int argc, char **argv, char **env)
{

 pl_start();
 printf("pl started\n");
 evalCode("{my $a=5; my $b=6; $a+$b;}");
 evalCode(" bad bad ");
 evalCode(" {my $str='test1357'; $str=~/\\d+/}");

 pl_stop();
 printf("pl stopped\n");
 return 0;
}


